from Tkinter import *
import random

class Pyew:
	"""A class for messing with Tkinter."""
	def __init__(self):
		self.root = Tk()
		self.root.geometry('800x800')
		self.canvas = Canvas(root, width=800, height=800)
		self.canvas.pack()
		
		self.moving_shape   = -1
		self.moving_shape_x = -1
		self.moving_shape_y = -1
		
		self.circles = {}
		self.lines = {}
		self.squares = {}
		
		self.color = self.random_color()
		
		# Bind events to handlers.
		root.bind('<Key>', key_handler)
		
		canvas.bind('<Button-1>',        left_button_handler)
		canvas.bind('<B1-Motion>',       left_button_motion_handler)
		canvas.bind('<ButtonRelease-1>', left_button_up_handler)
		canvas.bind('<Button-2>',        right_button_down_handler)
		canvas.bind('<B2-Motion>',       right_button_motion_handler)
		canvas.bind('<ButtonRelease-2>', right_button_up_handler)
		canvas.bind('<Button-3>',        middle_button_down_handler)
		canvas.bind('<B3-Motion>',       middle_button_motion_handler)
		canvas.bind('<ButtonRelease-3>', middle_button_up_handler)